package com.wy.two.Prototype;

/**
 * @author 33117
 * @version 1.0
 * @data 2025/3/10 16:27
 * 原型模式
 */
public class PrototypeExample {
    public static void main(String[] args) {
        // 创建原型对象
        Shape circle = new Shape("Circle");

        // 克隆原型对象来创建新对象
        Shape clonedCircle = circle.clone();
        clonedCircle.setType("Cloned Circle");

        // 输出原型对象和克隆对象的类型
        System.out.println("Original Shape Type: " + circle.getType());
        System.out.println("Cloned Shape Type: " + clonedCircle.getType());
    }
}
